package lab02.test13;

public class School extends ComputerAverage {
    @Override
    double average(double[] score) {
        //赋值，避免影响原数组的值
        double[] score1 = new double[score.length];
        for (int i = 0;i < score.length;i++) {
            score1[i] = score[i];
        }

        double sum = 0;
        //求成绩之和
        for (int i = 0; i < score.length; i++) {
            sum = sum + score1[i];
        }
        //计算平均值
        double average = sum / score1.length;

        return average;
    }
}
